﻿using System.Security.Cryptography;
using System.Xml.Linq;

namespace SvGame.Logic;

public static partial class GameLogic
{
    public static RoleInfoPerform InfoPerform(this Player player)
    {
        var info = new RoleInfoPerform();
        foreach (var conf in ConfPerform.Values)
        {
            // 判断门派
            if (!(conf.Family.IsNullOrEmpty() || player.Family == conf.Family))
            {
                continue;
            }
            // 武器类型
            if (!((EWeaponType)conf.WeaponType == EWeaponType.不限
                || (EWeaponType)conf.WeaponType == player.Comb.ActEquipWeaponType))
            {
                continue;
            }

            info.Performs.Add(conf.Id);
        }
        return info;
    }
    public static void NtfPlayerPerform(this Player player)
    {
        var ntf = new G2CNtfPerforms();
        ntf.InfoPerform = player.InfoPerform();
        player.Send(ntf);
    }
}
